using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableViewVegetablesType
	{
		public const string Table = "View_VegetablesType";
		public const string VegetablesTypeID = "VegetablesTypeID";
		public const string VegetablesTypeName = "VegetablesTypeName";
		public const string ProductCategoryID = "ProductCategoryID";
		public const string Sort = "Sort";
		public const string CategoryName = "CategoryName";
	}
	
	[Serializable]
	public class BaseViewVegetablesType
		: IDbSessionEntity, IJsonClass
	{
		int m_VegetablesTypeID;
		/// <summary>
        /// 
        /// </summary>
        public int VegetablesTypeID
        {
            get { return m_VegetablesTypeID; }
            set { m_VegetablesTypeID = value; }
        }
		
		string m_VegetablesTypeName;
		/// <summary>
        /// 
        /// </summary>
        public string VegetablesTypeName
        {
            get { return m_VegetablesTypeName; }
            set { m_VegetablesTypeName = value; }
        }
		
		int? m_ProductCategoryID;
		/// <summary>
        /// 
        /// </summary>
        public int? ProductCategoryID
        {
            get { return m_ProductCategoryID; }
            set { m_ProductCategoryID = value; }
        }
		
		int m_Sort;
		/// <summary>
        /// 
        /// </summary>
        public int Sort
        {
            get { return m_Sort; }
            set { m_Sort = value; }
        }
		
		string m_CategoryName;
		/// <summary>
        /// 
        /// </summary>
        public string CategoryName
        {
            get { return m_CategoryName; }
            set { m_CategoryName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_VegetablesTypeID = reader[TableViewVegetablesType.VegetablesTypeID];
            m_VegetablesTypeName = reader[TableViewVegetablesType.VegetablesTypeName];
            m_ProductCategoryID = reader[TableViewVegetablesType.ProductCategoryID];
            m_Sort = reader[TableViewVegetablesType.Sort];
            m_CategoryName = reader[TableViewVegetablesType.CategoryName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
        }
		
		public string TableName
        {
            get { return TableViewVegetablesType.Table; }
        }
		#endregion
		
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_VegetablesTypeID = hashToRead["VegetablesTypeID"];
			 
             m_VegetablesTypeName = hashToRead["VegetablesTypeName"];
			 
             m_ProductCategoryID = hashToRead["ProductCategoryID"];
			 
             m_Sort = hashToRead["Sort"];
			 
             m_CategoryName = hashToRead["CategoryName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["VegetablesTypeID"] = VegetablesTypeID;
			
            hashToFill["VegetablesTypeName"] = VegetablesTypeName;
			
            hashToFill["ProductCategoryID"] = ProductCategoryID;
			
            hashToFill["Sort"] = Sort;
			
            hashToFill["CategoryName"] = CategoryName;
			
        }

        #endregion
		
	}
}
